package models.user;

public class User implements Comparable<User>{

	private String username;
	private String password;
	private String email;
	private int wins;
	private int losses;

	
	public int getWins() {
		return wins;
	}

	public void setWins(int wins) {
		this.wins = wins;
	}

	public int getLosses() {
		return losses;
	}

	public void setLosses(int losses) {
		this.losses = losses;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Override
	public String toString() {
		return "User [username=" + username + ", password=" + password
				+ ", email=" + email + "]";
	}

	@Override
	public int compareTo(User o) {
		if ((this.wins - this.losses) > (o.getWins()-o.getLosses()))
			return -1;
		else if ((this.wins - this.losses) < (o.getWins()-o.getLosses()))
			return 1;
		else
			return 0;
	}
	
}
